package com.yilu.driver.mvp.model;


import com.is.common.retrofitrxcache.RxCacheResult;
import com.is.common.rx.RxSchedulers;
import com.yilu.driver.api.DriverApi;
import com.yilu.driver.base.Retrofit2Driver;
import com.yilu.driver.entity.Weather;
import com.yilu.driver.mvp.contract.ProjectListContract;
import rx.Observable;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

public class ProjectListModel implements ProjectListContract.Model {


    @Override
    public Observable<RxCacheResult<Weather>> getWeather(String key) {

        return Retrofit2Driver.getDefault(DriverApi.class).getWeather(key)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .compose(RxSchedulers.<RxCacheResult<Weather>>io_main());
               /* .map(new Func1<BaseResponse<List<Project>>, List<Project>>() {
                    @Override
                    public List<Project> call(BaseResponse<List<Project>> girlData) {
                        return girlData.data;
                    }
                })*/
        //   .compose(RxHelper.<List<Project>>handleResult());
    }
}
